home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 July / EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso / earcd / biz / swood / fw_mef.lha / FW_MEf / MEinfügen_V3.fwrexx.long < prev    next >
Text File  |  1997-04-27  |  6KB  |  249 lines

  1. /* ============================================ */
  2. /* Final Writer Arexx Macro - Mehrfach Einfügen */
  3. /* This macro will duplicate any selected       */
  4. /* graphic objects. (group or ungroup)          */
  5. /* by Heiko Schröder (Age Ass)                  */
  6. /* $VER: Mehrfach Einfügen 1.5 (08.04.97) für V3*/
  7. /* DocItemPrefs Abfrage                         */
  8. /* ============================================ */
  9. R='0A'X
  10. Dre=0
  11. Sei=0
  12.  
  13. Address='FinalW'
  14. Options results
  15.  
  16. STATUS PORTNAME
  17. FW = result
  18. address = FW
  19.  
  20. SIGNAL ON BREAK_C
  21. SIGNAL ON SYNTAX
  22.  
  23. 'ShowMessage 2 0 "Mehrfach Einfügen V1.5 - 08.04.97" "    Neu: Das Shareware-Paket" "Info im Mehrfach-Einfügen-Guide" "(-:" "Ok" ":-)"'
  24.  
  25. GetDocItemPrefs Decimal
  26. Punkt=Result
  27. If Punkt="Comma" then DocItemPrefs Decimal Period
  28.  
  29. GraphicTool
  30. Ungroup
  31. nr=1
  32. CurrentObject
  33. ObjectId = Result
  34. IF ObjectId=0 THEN do
  35.    'ShowMessage 1 1 "Makro: Mehrfach Einfügen" "Kein Grafikobjekt ausgewählt..." "" "Okay" "" ""'
  36.    Call BREAK_C
  37. End
  38.  
  39. /*Kontrolle ob ein oder mehrere Objekte ausgewählt sind*/
  40.  
  41. Objekt.0=nr; Objekt.nr=ObjectID
  42. FirstObject Selected
  43. ID=result
  44. Call Zaehlen
  45. Do While 1
  46.    NextObject ID Selected
  47.    ID=result
  48.    If ID=0 then Leave
  49.    Call Zaehlen
  50. End
  51.  
  52. If Objekt.0=1 then do
  53.    gruppe=false
  54. end
  55. else gruppe=true
  56.  
  57. /*Ende der Kontrolle*/
  58.  
  59. STATUS View
  60. Zoom=result
  61.  
  62. STATUS Pages
  63. Seiten=result
  64.  
  65. STATUS Page
  66. Seite=result
  67. kx=9999
  68. ky=9999
  69. If Gruppe=true then
  70.    Do a=1 to Objekt.0
  71.    GetObjectCoords Objekt.a
  72.    Parse var result Soite ax ay rest
  73.    if ax<kx then kx=ax
  74.    if ay<ky then ky=ay
  75. end
  76.  
  77. Do a=2 to Objekt.0
  78.    SelectObject Objekt.a MULTIPLE
  79. End
  80. SelectObject Objekt.1 MULTIPLE
  81.  
  82. If Gruppe=true then Group
  83.  
  84. Copy
  85. IF RC=0 THEN do
  86.    CurrentObject
  87.    ObjectID=result
  88.    GetObjectCoords ObjectID
  89.    Parse var result Seite x y w h
  90.    wl=w
  91.    hl=h
  92.    if Gruppe=true then do
  93.       x=kx; y=ky
  94.    End
  95.    GetObjectRotation ObjectID
  96.    Dreh=result
  97.    GetObjectType ObjectID
  98.    Typ=result
  99.  
  100.    If Typ=2|Typ=3 then do
  101.       If Seite~=1 then do
  102.          'ShowMessage 1 1 "FW hat Probleme mit Linien außerhalb" "der Seite 1... " "" "Okay" "" ""'
  103.          Call BREAK_C
  104.       End
  105.    End
  106.    If Gruppe=true then Group
  107.  
  108.    'ShowMessage 1 0 "Wie soll die Bildschirmausgabe erfolgen?" "" "" "Normal" "Speed" ""'
  109.    ba=result
  110.  
  111.    IF ba=2 THEN DO
  112.       status WINDOW
  113.       parse VAR result links oben width height minwidth minheight maxwidth maxheight
  114.       sizewindow minwidth minheight
  115.    End
  116.  
  117.    Do While 1
  118.       Result="ß"
  119.       RequestText '"Mehrfach Einfügen" "Anzahl der Kopien" ""'
  120.       Anzahl=Result
  121.       If Anzahl="ß" then call Ende1
  122.       If Anzahl=""|Anzahl=0 then call Ende
  123.       If Datatype(Anzahl,'W')=1 then leave
  124.             else call oops
  125.    End
  126.  
  127.    Do while 1
  128.       Result="ß"
  129.       RequestText '"Mehrfach Einfügen" "Horizontale Verschiebung in cm" ""'
  130.       Hor=Result
  131.       If Hor="ß" then call Ende1
  132.       If Hor="" then Hor=0
  133.       If Datatype(Hor,'N')=1 then leave
  134.             else call oops1
  135.    End
  136.  
  137.    Do while 1
  138.       Result="ß"
  139.       RequestText '"Mehrfach Einfügen" "Vertikale Verschiebung in cm" ""'
  140.       Ver=Result
  141.       If Ver="ß" then call Ende1
  142.       If Ver="" then Ver=0
  143.       If Datatype(Ver,'N')=1 then leave
  144.             else call oops1
  145.    End
  146.  
  147.    If Typ~=2&Typ~=3 then do                     /*Linien*/
  148.       Do while 1
  149.          Result="ß"
  150.          RequestText '"Mehrfach Einfügen" "Drehung in Grad" ""'
  151.          Dre=Result
  152.          If Dre="ß" then call Ende1
  153.          If Dre="" then Dre=0
  154.          If Datatype(Dre,'W')=1 then leave
  155.             else call oops
  156.       End
  157.  
  158.       Do While 1
  159.          Result="ß"
  160.          RequestText '"Mehrfach Einfügen" "Auf welche Seite? 0=dieselbe Seite" ""'
  161.          Sei=Result
  162.          If Sei="ß" then call Ende1
  163.          If Sei=""|Sei=0 then Sei=Seite
  164.          If Datatype(Sei,'W')=1 then leave
  165.             else call oops
  166.       End
  167.    end
  168.  
  169.    s=Sei-Seiten
  170.  
  171.    Do a=1 to s
  172.       InsertPageBreak
  173.    End
  174.       
  175.    If ba=2 then View 20
  176.    Do i=1 TO Anzahl
  177.       Paste
  178.       CurrentObject
  179.       ObjectID=Result
  180.       a=x+(Hor*i)
  181.       b=y+(Ver*i)
  182.       Winkel=Dreh+Dre*i
  183.       If Typ=2|Typ=3 then do                     /*Linien*/
  184.          w=wl+(Hor*i)
  185.          h=hl+(Ver*i)
  186.          Sei=Seite
  187.       End
  188.       SetObjectCoords ObjectID Sei a b w h    /*Probleme bei Linien*/
  189.       SetObjectRotation ObjectID Winkel
  190.       If Gruppe=true then Group
  191.    End
  192. End
  193. Redraw
  194.  
  195. Call WH
  196.  
  197. 'ShowMessage 2 1 "Vielen Dank für die Benutzung." "© Heiko Schröder" "http://yi.com/home/SchroederHeiko" "@-`-" "Bitte" ":-))"'
  198. Exit
  199.  
  200. ENDE:
  201.    Call WH
  202.    'ShowMessage 1 1 "Falsche Anzahl an Kopien..." "A B B R U C H" "" "Okay" "" ""'
  203.    EXIT
  204.  
  205. ENDE1:
  206.    Call WH
  207.    'ShowMessage 1 1 "Sie haben abgebrochen..." "© Heiko Schröder" "http://yi.com/home/SchroederHeiko" "Okay" "" ""'
  208.    EXIT
  209.  
  210. SYNTAX:
  211.    Call WH
  212.    'ShowMessage 1 1 "Es ist ein Fehler aufgetreten." "Nähere Info in Datei «Ram:Fehler«" "" "Was?" "Gibts nicht!" "Sofort melden"'
  213.    address "REXX"
  214.    Open("F","Ram:Fehler","W")
  215.    writeln("F","ACHTUNG! FW_MEf V1.4 Makro-Fehler"||R)
  216.    writeln("F",'Fehler in Zeile' SIGL ':' ERRORTEXT(RC)||R)
  217.    writeln("F", 'Bitte informieren Sie den Autor unter s93324@fh-telekom-leipzig.de')
  218.    Close("F")
  219. EXIT
  220.  
  221. BREAK_C:
  222.    Call WH
  223.    'ShowMessage 1 1 "Makro-Abbruch..." "" "" "Ich weiß..." "" ""'
  224.    EXIT
  225.  
  226. WH:
  227.    If ba=2 then do
  228.       GoToPage Sei
  229.       View Zoom
  230.       sizewindow width height
  231.    End
  232.    If Punkt="Comma" then DocItemPrefs DECIMAL Comma
  233. Return
  234.  
  235. Zaehlen:
  236. If ID~=Objekt.1 then do
  237.    nr=nr+1
  238.    Objekt.0=nr; Objekt.nr=ID
  239. End
  240. Return
  241.  
  242. oops:
  243. 'ShowMessage 1 1 "Falsche Eingabe!" "Bitte ganzzahlige Eingabe!" "" "Okay" "" ""'
  244. return
  245.  
  246. oops1:
  247. 'ShowMessage 1 1 "Falsche Eingabe!" "Bitte numerische Eingabe mit (.) !" "" "Okay" "" ""'
  248. return
  249.